<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="./jquery/jquery-1.12.4.min.js"></script>
<style>
    .box {
        width: 100px;
        height: 100px;
        background-color: red;
    }
</style>

<body>
    <div class="box"></div>
    <button class="btn1">向上滑动/隐藏</button>
    <button class="btn2">向下滑动/显示</button>
    <button class="btn3">切换/切换</button>
    <script>
        /*    $('.btn1').click(function () {
               // 向上滑动
               $('.box').slideUp(1000, function () {
                   console.log('slideUp');
               });
           })
   
           $('.btn2').click(function () {
               // 向下滑动
               $('.box').slideDown(1000, function () {
                   console.log('slideDown');
               });
           })
   
           $('.btn3').click(function () {
               // 向下滑动
               $('.box').slideToggle(1000, function () {
                   console.log('slideToggle');
               });
           }) */

        $('.btn1').click(function () {
            $('.box').hide(1000, function () {
                console.log('hide');
            });
        })

        $('.btn2').click(function () {
            $('.box').show(1000, function () {
                console.log('show');
            });
        })

        $('.btn3').click(function () {
            $('.box').toggle(1000, function () {
                console.log('toggle');
            });
        })

    </script>
</body>

</html>